<template>
  <div class="container">
    <!-- reactive是一个函数，它可以定义一个复杂数据类型，成为响应式数据。 -->
    <div>  reactive是用来定义响应式对象数据</div>
    <div>{{object.name}}</div>
    <div>{{object.age}}</div>
    <button @click="updateName">修改数据</button>
  </div>
</template>
<script>
import { reactive } from "vue";
export default {
  name: "Reactive",
  setup() {
    const object = reactive({
      name: "reactive",
      edition: "vue3",
    });
    const updateName = () => {
      console.log("updateName");
      object.name = "zs";
    }
    return { object ,updateName}
  },
};
</script>